package services

import (
	"fmt"
	"goCommerce/models"
)

type UserService struct{}

func NewUserService() *UserService {
	return &UserService{}
}

func (s *UserService) Add(user *models.User) bool {
	dbEngine.Insert(user)
	return true
}

func (s *UserService) List() []models.User {
	users := make([]models.User, 0)
	fmt.Println("dbEngine.DataSourceName:", dbEngine.DataSourceName())
	dbEngine.Find(&users)
	return users
}
